//
//  VCZunxiang.swift
//  PosApp
//
//  Created by HippieFox on 2019/8/2.
//  Copyright © 2019 李英新. All rights reserved.
//

import UIKit

class VCZunxiang: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        
        NotificationCenter.default.addObserver(self, selector: #selector(handleNotification(_:)), name: RouterManager.alipaySuccessNotificationName(), object: nil)
        
    }
    
    @IBAction func updateZunxiang(_ sender: Any) {
        RouterManager.updateZunXiang()
//        NotificationCenter.default.post(Notification.init(name: RouterManager.alipaySuccessNotificationName()))
    }
    
    @objc func handleNotification(_ notification:Notification){
        if notification.name == RouterManager.alipaySuccessNotificationName(){
            let sb = UIStoryboard.init(name: "Main", bundle: nil)
            let vc = sb.instantiateViewController(withIdentifier: "VCUpdateSuccess")
            self.view.addSubview(vc.view)
            self.addChild(vc)
        }
    }
    
    deinit {
        NotificationCenter.default.removeObserver(self)
    }
    
}
